"""
Air transitions from 
http://www.pa.uky.edu/~peter/atomic/ 
http://physics.nist.gov/PhysRefData/ASD/lines_form.html
Created on Oct 5, 2009
@author: aamn
"""
indices = {\
# Fraunhofer K
				"CaIIK":{"air":[3933.66, ],
							"N":[[3923.7, 3943.7, 1.]],
							"D":[[3943.7, 3953.7, 1.]],
							"type":0,
							"title":ur"Ca \u0399\u0399 \u03BB3933",
							"dictindex":0,
							"provenance":["2007AJ....134.2398C"]},
# Fraunhofer h
				"Hdelt":{"air":[4101.74, ],
							"N":[[4086.7, 4116.7, 1.]],
							"D":[[4136.7, 4176.7, 1.]],
							"type":0,
							"title":ur"H\u03B4",
							"dictindex":1,
							"provenance":["2007AJ....134.2398C"]},
# 
				"CaI4227":{"air":[4226.73, ],
							"N":[[4216.7, 4236.7, 1.]],
							"D":[[4236.7, 4256.7, 1.]],
							"type":0,
							"title":ur"Ca \u0399 \u03BB4227",
							"dictindex":2,
							"provenance":["2007AJ....134.2398C"]},
#	continuum kinda tight. no metallicity sensitivity on purpose?
				"Gband":{"air":[4300, ],
								"N":[[4285.0, 4315.0, 1.]],
								"D":[[4260.0, 4285.0, 1.]],
								"type":0,
								"title":ur"CH+Fe \u0399 \u03BB4300",
								"dictindex":3,
								"provenance":["2007AJ....134.2398C"]},
# Fraunhofer G'
				"Hgamm":{"air":[4340.47, ],
								"N":[[4332.5, 4347.5, 1.]],
								"D":[[4355.0, 4370.0, 1.]],
								"type":0,
								"title":ur"H\u03B3 ",
								"dictindex":4,
								"provenance":["2007AJ....134.2398C"]},
#
				"FeI4383":{"air":[4383.54, ],
								"N":[[4378.6, 4388.6, 1.]],
								"D":[[4355.0, 4370.0, 1.]],
								"type":0,
								"title":ur"Fe \u0399 \u03BB4383",
								"dictindex":5,
								"provenance":["2007AJ....134.2398C"]},
#
				"FeI4405":{"air":[4404.75, ],
								"N":[[4399.8, 4409.8, 1.]],
								"D":[[4414.8, 4424.8, 1.]],
								"type":0,
								"title":ur"Fe \u0399 \u03BB4405",
								"dictindex":6,
								"provenance":["2007AJ....134.2398C"]},
#
				"BlueColor":{"air":[4600, ],
								"N":[[6100.0, 6300.0, 1.]],
								"D":[[4500.0, 4700.0, 1.]],
								"type":1,
								"title":ur"Blue Color",
								"dictindex":7,
								"provenance":["2007AJ....134.2398C"]},
# Fraunhofer F
				"Hbeta":{"air":[4861.33, ],
							"N":[[4847.0, 4877.0, 1.]],
							"D":[[4817.0, 4847.0, 1.]],
							"type":0,
							"title":ur"H\u03B2",
							"dictindex":8,
							"provenance":["2007AJ....134.2398C"]},
# Fraunhofer b1,X,b2
				"MgI5172":{"air":[5167.32, 5172.68, 5183.60, ],
							"N":[[5152.7, 5192.7, 1.]],
							"D":[[5100.0, 5150.0, 1.]],
							"type":0,
							"title":ur"Mg \u0399 \u03BB5167,5172,5183",
							"dictindex":9,
							"provenance":["2007AJ....134.2398C"]},
# the "D" solar line
				"NaI5893":{"air":[5889.95, 5895.92, ],
							"N":[[5880.0, 5905.0, 1.]],
							"D":[[5910., 5935.0, 1.]],
							"type":0,
							"title":ur"Na \u0399 \u03BB5889,5895",
							"dictindex":10,
							"provenance":["2007AJ....134.2398C"]},
# 6162 line; sideband includes the 6122 line. its actually more like TiO6080
				"CaI6162":{"air":[6162.17, ],
							"N":[[6150.0, 6175.0, 1.]],
							"D":[[6120.0, 6145.0, 1.]],
							"type":0,
							"title":ur"Ca \u0399 \u03BB6162",
							"dictindex":11,
							"provenance":["2007AJ....134.2398C"]},
#
				"Halpha":{"air":[6562.80, ],
								"N":[[6548.0, 6578.0, 1.]],
								"D":[[6583.0, 6613.0, 1.]],
								"type":0,
								"title":ur"H\u03B1",
								"dictindex":12,
								"provenance":["2007AJ....134.2398C"]},
# 
				"CaH3":{"air":[6975, ],
							"N":[[6960.0, 6990.0, 1.]],
							"D":[[7042.0, 7046.0, 1.]],
							"type":0,
							"title":ur"CaH \u03BB6975",
							"dictindex":13,
							"provenance":["2007AJ....134.2398C", "1995AJ....109.1379A",
													"1991ApJS...77..417K"]},
# Kirkpatrick 99's TiO-a is the blue side of this broad TiO; TiO-5 is middle.
				"TiO5":{"air":[7053, ],
							"N":[[7126.0, 7135.0, 1.]],
							"D":[[7042.0, 7046.0, 1.]],
							"type":0,
							"title":ur"TiO \u03BB7053",
							"dictindex":14,
							"provenance":["2007AJ....134.2398C", "1995AJ....110.1838R"]},
# 7434 is some kind of "middle" to the VO that starts at 7334
				"VO7434":{"air":[7434, ],
								"N":[[7430.0, 7470.0, 1.]],
								"D":[[7550.0, 7570.0, 1.]],
								"type":0,
								"title":ur"VO \u03BB7434",
								"dictindex":15,
								"provenance":["2007AJ....134.2398C", "2002AJ....123.3409H"]},
#
				"VO-a":{"air":[7434, ],
							"N":[[7350.0, 7400.0, 0.5625], [7510.0, 7560.0, 0.4375]],
							"D":[[7420.0, 7470.0, 1.]],
							"type":1,
							"title":ur"VO \u03BB ~7434",
							"dictindex":16,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"VO-b":{"air":[7912, ],
							"N":[[7860.0, 7880.0, 0.5], [8080.0, 8100.0, 0.5]],
							"D":[[7960.0, 8000.0, 1.]],
							"type":1,
							"title":ur"VO \u03BB ~7912",
							"dictindex":17,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"VO7912":{"air":[7912, ],
							"N":[[7900.0, 7980.0, 1.]],
							"D":[[8100.0, 8150.0, 1.]],
							"type":0,
							"title":ur"VO \u03BB7912",
							"dictindex":18,
							"provenance":["2007AJ....134.2398C", "2002AJ....123.3409H"]},
#
				"Rb-b":{"air":[7947.60, ],
							"N":[[7922.6, 7932.6, 0.5], [7962.6, 7972.6, 0.5]],
							"D":[[7942.6, 7952.6, 1.]],
							"type":1,
							"title":ur"Rb \u0399 \u03BB7947.6",
							"dictindex":19,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"NaI8189":{"air":[8183.25, 8194.82, ],
							"N":[[8177.0, 8201.0, 1.]],
							"D":[[8151.0, 8175.0, 1.]],
							"type":0,
							"title":ur"Na \u0399 \u03BB8183,8195",
							"dictindex":20,
							"provenance":["2007AJ....134.2398C", "2002AJ....123.3409H",
														"1991ApJS...77..417K"]},
#
				"TiO-b":{"air":[8432, ],
							"N":[[8400.0, 8415.0, 1.]],
							"D":[[8455.0, 8470.0, 1.]],
							"type":0,
							"title":ur"TiO \u03BB8432",
							"dictindex":21,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"TiO8440":{"air":[8440, ],
							"N":[[8440.0, 8470.0, 1.]],
							"D":[[8400.0, 8420.0, 1.]],
							"type":0,
							"title":ur"TiO \u03BB8440",
							"dictindex":22,
							"provenance":["2007AJ....134.2398C", "2002AJ....123.3409H"]},
#
				"Cs-a":{"air":[8521, ],
							"N":[[8496.1, 8506.1, 0.5], [8536.1, 8546.1, 0.5]],
							"D":[[8516.1, 8526.1, 1.]],
							"type":1,
							"title":ur"Cs \u0399 \u03BB8521.1",
							"dictindex":23,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"CaII8498":{"air":[8498.03, ],
								"N":[[8483.0, 8513.0, 1.]],
								"D":[[8513.0, 8543.0, 1.]],
							"type":0,
							"title":ur"Ca \u0399\u0399 \u03BB8498",
							"dictindex":24,
							"provenance":["2007AJ....134.2398C"]},
#
				"CrH-a":{"air":[8611, ],
							"N":[[8580.0, 8600.0, 1.]],
							"D":[[8621.0, 8641.0, 1.]],
							"type":0,
							"title":ur"CrH \u03BB8611",
							"dictindex":25,
							"provenance":["2007AJ....134.2398C", "1999ApJ...519..802K"]},
#
				"CaII8662":{"air":[8662.14, ],
								"N":[[8650.0, 8675.0, 1.]],
								"D":[[8625.0, 8650.0, 1.]],
								"type":0,
								"title":ur"Ca \u0399\u0399 \u03BB8662",
								"dictindex":26,
								"provenance":["2007AJ....134.2398C"]},
#
				"FeI8689":{"air":[8688.62, ],
								"N":[[8684.0, 8694.0, 1.]],
								"D":[[8664.0, 8674.0, 1.]],
								"type":0,
								"title":ur"Fe \u0399 \u03BB8689",
								"dictindex":27,
								"provenance":["2007AJ....134.2398C"]},
#
				"color1":{"air":[9000., ],
								"N":[[8900.0, 9100.0, 1.]],
								"D":[[7350.0, 7550.0, 1.]],
								"type":1,
								"title":ur"Color-1",
								"dictindex":28,
								"provenance":["2007AJ....134.2398C", "2002AJ....123.3409H"]},
#
				"color2":{"air":[7450, ],
								"N":[[7350.0, 7550.0, 1.]],
								"D":[[6100.0, 6300.0, 1.]],
								"type":1,
								"title":ur"Color-2",
								"dictindex":29,
								"provenance":["2007AJ....134.2398C"]},
	}

# provenance gives the origin of the spectral *index* not the line itself.
# 2007AJ....134.2398C  (Covey et al.,  SED Locus & Hammer Appendix)
# 2002AJ....123.3409H  (Hawley et al., MLT in SDSS)
# 1999ApJ...519..802K  (Kirkpatrick et al., "L type")
# 1995AJ....109.1379A  (Allen & Strom, Spectral Standards)
# 1995AJ....110.1838R  (Reid et al., psmu northern m dwarfs)
# 1993PASP..105..693T  (Torres-Dodgen & Weaver, nir spec normal stars)
# 1991ApJS...77..417K  (Kirkpatrick et al., "spectral seq in red")
# 1985ApJS...59...33P  (Pickles, Spectrophotometric atlas) 

def lines(indices):
	lines = {}
	lineskeys = ['air', 'title']
	for foo in indices.keys():
		lines[foo] = dict([(bah, indices[foo][bah]) for bah in lineskeys])
